package com.tvunetworks.center.user.service;

import com.github.pagehelper.PageInfo;
import com.tvunetworks.center.common.model.dto.customizedcc.GroupUserAndRids;
import com.tvunetworks.center.user.model.CustomizedUserGroup;
import com.tvunetworks.center.user.model.param.AddGroupParam;
import com.tvunetworks.center.user.model.param.PageCustomizedUserGroupParam;
import com.tvunetworks.center.user.model.vo.CustomizedUserGroupVo;

import java.util.List;
/**
 * @program: tvucc-aggregator
 * @author lebronchen
 * @create: 2020-04-24 13:17
 **/
public interface CustomizedUserGroupService {
    /**
     *
     * @param param param
     */
    void addGroup(AddGroupParam param);

    /**
     *
     * @param param param
     * @return PageInfo
     */
    PageInfo<CustomizedUserGroupVo> listUserGroup(PageCustomizedUserGroupParam param);

    /**
     *
     * @param id id
     * @return CustomizedUserGroup
     */
    CustomizedUserGroup getById(String id);

    /**
     *
     * @param userId userId
     * @return String
     */
    String getUserDefaultGroupName(String userId);

    /**
     *
     * @param userId userId
     * @return CustomizedUserGroup
     */
    CustomizedUserGroup getUserDefaultGroup(String userId);

    /**
     *
     * @param userId userId
     * @param id id
     */
    void deleteGroup(String userId, String id);

    /**
     *
     * @param userId userId
     * @param param param
     */
    void updateGroup(String userId, AddGroupParam param);

    /**
     * 判断 group 是否存在
     * @param group group
     * @return boolean
     */
    boolean isGroupExist(String group);

    /**
     * 列出拥有 group 的用户
     * @param group group
     * @return List
     */
    List<String> listGroupUser(String group);

    /**
     * 查询 Group 所属的用户，以及所属用户所有的 rid
     * @param group group
     * @return GroupUserAndRids
     */
    GroupUserAndRids getGroupUserAndRids(String group);

    /**
     *
     * @param id id
     * @return String
     */
    String getGroupNameById(String id);

    /**
     * 查询用户设备的 分组
     * @param userId userId
     * @param peerId peerId
     * @return String
     */
    String getGroupNameByUserDevice(String userId, String peerId);
}
